#define _CRT_SECURE_NO_WARNINGS 1 
#include<stdio.h>
void printR(char* a,int sum)
{
	if ('0' < *a  && *a <= '9' && *(a + 1) == '[')
	{
		printR(a + 2,*a-'0');
	}

	while (*a != ']')
	{
		int k = sum;
		while (sum--)
		{
			printf("%c", *a);
		}
		a++;
	}

	while (*a != '\0' || (('0' >= *a || *a >= '9') && *(a + 1) != '['))
	{
		printf("%c", *a);
		a++;
	}


}